package com.demo.strategy;

/**
 * 满减策略
 */
public class ReturnStrategy implements  Strategy{

    public ReturnStrategy(double condition, double returnMoney) {
        this.condition = condition;
        this.returnMoney = returnMoney;
    }

    // 满多少
    private double condition = 0.0d;

    // 减多少

    private double returnMoney = 0.0d;

    @Override
    public double priceCalculate(double money) {
        double result = money;
        // 满足条件做满减
        if (money >= condition) {
            result = money - returnMoney;
        }
        return result;
    }
}
